#include<iostream>
using namespace std;

#include<vector>


int minCost(vector<vector<int>>& costs) {
	int length = costs.size();
	vector<int>dp1(length, 0);
	vector<int>dp2(length, 0);
	vector<int>dp3(length, 0);
	dp1[0] = costs[0][0];
	dp2[0] = costs[0][1];
	dp3[0] = costs[0][2];
	for (int i = 1; i < length; i++)
	{
		dp1[i] = min(dp2[i - 1], dp3[i - 1]) + costs[i][0];
		dp2[i] = min(dp1[i - 1], dp3[i - 1]) + costs[i][1];
		dp3[i] = min(dp2[i - 1], dp1[i - 1]) + costs[i][2];
	}
	return min(dp1[length - 1], min(dp2[length - 1], dp3[length - 1]));

}

int main()
{
	return 0;
}